
package xyz.zq.cloud.bs.api.feign.fallback;

import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import xyz.zq.cloud.bs.api.entity.Log;
import xyz.zq.cloud.bs.api.feign.RemoteLogService;
import xyz.zq.cloud.common.core.util.R;

/**
 * 远程日志服务回退
 */
@Slf4j
@Component
public class RemoteLogServiceFallbackImpl implements RemoteLogService {
    @Setter
    private Throwable cause;

    /**
     * 保存日志
     *
     * @param sysLog 日志实体
     * @param from   内部调用标志
     * @return succes、false
     */
    @Override
    public R<Boolean> saveLog(Log sysLog, String from) {
        log.error("feign 插入日志失败", cause);
        return null;
    }
}
